function showError(label, xhr, textStatus, errorThrown){
    /* 错误信息处理 */
    alert(label + ": \n"
        + "状态码: " + xhr.status + "\n"
        //当前状态,0-成功,1-失败,2-已经载入,3-数据进行交互,4-完成
        + "状态: " + xhr.readyState + "\n"
        + "错误信息: " + xhr.statusText + "\n"
        //详细信息
        + "返回响应信息: " + xhr.responseText + "\n"
        + "请求状态: " + textStatus + "\n"
        + "完整异常: " + errorThrown);
}

function StringBuilder() {
    this.strings = new Array("");
    this.strings.length = 0;
}

// Appends the given value to the end of this instance.
StringBuilder.prototype.append = function (value) {
    if (value) {
        this.strings.push(value);
    }
}
// Clears the string buffer
StringBuilder.prototype.clear = function () {
    this.strings.length = 0;
}
// Converts this instance to a String.
StringBuilder.prototype.toString = function () {
    return this.strings.join("");
}

StringBuilder.prototype.size = function () {
    return this.strings.length;
}